#!/bin/sh
NAME=xinhujava
PATH=$(pwd)
PROCESS=`ps -ef|grep "$NAME"|grep -v grep|grep -v PPID|awk '{ print $2}'`
for i in $PROCESS
do
  echo "Kill the $NAME process [ $i ]"
  kill -9 $i
done
echo "stop $NAME"
nohup java -jar $PATH/xinhujava.jar config=$PATH/config.ini action=start > $PATH/xinhujava_service.log 2>&1 &
echo "start $NAME success"